<template>
    <div>
        <h1>三方登录</h1>
        用户名：<input type="text" v-model="nikename">
        <button @click="login" style="color:pink">授权登录</button>
    </div>
</template>

<script>
    export default {
        data(){
            return{
                nikename:'',
                token:'',
                uid:'',
            }
        },
        methods:{
            login(){
                this.$axios.get('login/sf_login?nikename='+this.nikename).then(res=>{
                    if(res.data.code==200){
                        this.token = res.data.token
                        this.uid = res.data.uid
                        window.location.href=res.data.url
                    }
                    
                })
            }
        }
    }
</script>

<style scoped>

</style>